package com.xoa.controller.attendance.attendanceSetting;

import com.xoa.service.attendance.attendanceway.AttendanceWayService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
* @创建作者:李然  Lr
* @方法描述：考勤方式设置
* @创建时间：13:49 2018/9/19

**/
@Controller
@RequestMapping(value = "attendanceWay")
public class AttendanceWayController {

    @Autowired
    private AttendanceWayService attendanceWayService;


    /**
     * 设置考勤首页
     * @return
     */
    @RequestMapping(value = "/attindex")
    public String attindex(){
        return "app/attend/attindex";
    }



    /**
     * 去往考勤方式设置主页映射
     * @return
     */
    @RequestMapping(value = "/setting")
    public String AttendanceWaySetting(){
        return "app/attend/attendManagement/attendanceSetting";
    }

    /**
     * 获取考勤方式设置主页数据
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/settingMain")
    public ToJson AttendanceWaySettingMain(){
        return attendanceWayService.getDutyMachine();
    }

    @ResponseBody
    @RequestMapping(value = "/settingUpdate")
    public ToJson AttendanceWaySettingUpdate(String dutyMachine){
        return attendanceWayService.updateDutyMachine(dutyMachine);
    }






    /**
     * 设置考勤排班类型 映射
     * @return
     */
    @RequestMapping(value = "/scheduleType")
    public String scheduleType(){
        return "app/attend/attendanceSchedule/scheduleType";
    }

    /**
     *  按分组设置排班 映射
     * @return
     */
    @RequestMapping(value = "/workforceManagement")
    public String workforceManagement(){
        return "app/attend/attendanceSchedule/workforceManagement";
    }

    /**
     *   按人员调整排班 映射
     * @return
     */
    @RequestMapping(value = "/freeShift")
    public String freeShift(){
        return "app/attend/attendanceSchedule/freeShift";
    }

    /**
     * 批量设置排班 映射
     * @return
     */
    @RequestMapping(value = "/batchShiftManagement")
    public String batchShiftManagement(){
        return "app/attend/attendanceSchedule/batchShiftManagement";
    }
}
